package com.example.sliderchangeimagescanaphen.slice;

import com.example.sliderchangeimagescanaphen.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Image;
import ohos.agp.components.Slider;

public class MainAbilitySlice extends AbilitySlice implements Slider.ValueChangedListener {
    private Image image_scane;
    private Slider slider_opt,slider_opt2;
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_main);

        image_scane = (Image)findComponentById(ResourceTable.Id_image_scane);
        slider_opt = (Slider)findComponentById(ResourceTable.Id_slider_opt);
        slider_opt2 = (Slider)findComponentById(ResourceTable.Id_slider_opt2);
        slider_opt.setValueChangedListener(this);

    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }

    @Override
    public void onProgressUpdated(Slider slider, int i, boolean b) {
        image_scane.setScale(i/10,i/10);
        image_scane.setAlpha(i/10);
    }

    @Override
    public void onTouchStart(Slider slider) {

    }

    @Override
    public void onTouchEnd(Slider slider) {

    }
}
